<style>
    .layui-form-label {
        width: 70px;
    }
</style>
<div class="layuimini-container">
    <div class="layuimini-main" id="app">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li class="layui-this">邮件配置</li>
                <li>SMTP配置</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <form class="layui-form layuimini-form">
                        <input type="hidden" name="field" value="mail">
                        <div class="layui-form-item">
                            <label class="layui-form-label required">发送通道</label>
                            <div class="layui-input-block">
                                {foreach ['smtp'=>'SMTP'] as $key=>$val}
                                <input type="radio" v-model="send_type" name="send_type" lay-filter="send_type" value="{$key}" title="{$val}" {if $key==sysconfig('mail','send_type')}checked=""{/if}>
                                {/foreach}
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <input type="hidden" name="field" value="mail">
                            <label class="layui-form-label">站长邮箱(接收通知)</label>
                            <div class="layui-input-inline">
                                <textarea class="layui-textarea"  name="admin_email">{:sysconfig('mail.admin_email')}</textarea>
                            </div>
                            <button class="layui-btn"  lay-submit="ajax/sendmail" lay-filter="sendEmail">测试邮件</button>

                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">邮件模板[非必要不修改]</label>
                            <div class="layui-input-block">
                                <textarea class="layui-textarea"  name="msg_tpl">{:sysconfig('mail.msg_tpl')}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">单个邮箱一天限制条数</label>
                            <div class="layui-input-inline">
                                <input type="number" name="email_max" value="{:sysconfig('mail.email_max')}" placeholder="每个邮箱每天可发送条数" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">发送间隔(分钟)</label>
                            <div class="layui-input-inline">
                                <input type="number" name="interval_time" value="{:sysconfig('mail.interval_time')}" placeholder="每条短信发送间隔" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">同一IP一天限制</label>
                            <div class="layui-input-inline">
                                <input type="number" name="ip_max" value="{:sysconfig('mail.ip_max')}" placeholder="每条短信发送间隔" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">过期时间(分钟)</label>
                            <div class="layui-input-inline">
                                <input type="number" name="expiry_time" value="{:sysconfig('mail.expiry_time')}" placeholder="过期时间（分）" autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="hr-line"></div>
                        <div class="submit-info text-center">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="system.config/save" data-refresh="false">确认</button>
                            <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                        </div>

                    </form>
                </div>
                <div class="layui-tab-item">

                    <form class="layui-form layuimini-form">
                        <input type="hidden" name="field" value="smtp">

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width:100px;"><b>*</b> SMTP服务器</label>
                            <div class="layui-input-inline">
                                <input type="text" name="server" lay-verify="required" value="{:sysconfig('smtp.server')}" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width:100px;"></label>
                            <div class="layui-form-inline">发送邮箱的smtp地址，如: smtp.qq.com</div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width:100px;"><b>*</b> SMTP端口号</label>
                            <div class="layui-input-inline">
                                <input type="text" name="port" lay-verify="required" value="{:sysconfig('smtp.port')}" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width:100px;"></label>
                            <div class="layui-form-inline">
                                <span style="color:red;">一般都是465、994，西部数码或其他企业邮箱可以尝试端口 25</span>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width:100px;"><b>*</b> 邮箱账号</label>
                            <div class="layui-input-inline">
                                <input type="text" name="username" lay-verify="required" value="{:sysconfig('smtp.username')}" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width:110px;"><b>*</b> 邮箱密(授权)码</label>
                            <div class="layui-input-inline">
                                <input type="password" name="password"  lay-verify="required" value="{:sysconfig('smtp.password')}" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-col-md3">
                            <label class="layui-form-label">发件人名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="signature" value="{:sysconfig('smtp','signature')}"
                                       placeholder="用户收到后显示在发件人的名称，建议直接设置成网站名称" autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="hr-line"></div>
                        <div class="submit-info text-center">
                            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="system.config/save" data-refresh="false">确认</button>
                            <a class="layui-btn layui-btn-primary layui-btn-sm" layform-close>关闭</a>
                            <a  class="layui-btn layui-btn-sm" target="_blank" href="https://bbs.laysns.com/thread/2725.html">帮助文档</a>
                        </div>

                    </form>

                </div>

            </div>
        </div>

    </div>
</div>

